#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

branch="$(git rev-parse --abbrev-ref HEAD)"
user="$(git config user.name)"
whitelist=("bubkoo" "newbyvector")

if [[ ! " ${whitelist[@]} " =~ " ${user} " ]]; then
  if [ "$branch" = "master" ]; then
    echo "Push to master branch is forbidden."
    echo "Checkout your owne branch then submit a pr."
    exit 1
  fi
fi
